SRC = ./src
INC = ./include
OBJ = ./lib
INC = ./include

CC = gcc
CFLAGS = -g -Wall -I${INC}

SOURCES = $(wildcard ${SRC}/*.c)
OBJECTS = $(patsubst %.c, ${OBJ}/%.o, $(notdir ${SOURCES}))
TARGET = $(notdir $(shell pwd))

${TARGET}: ${OBJECTS}
	$(CC) -o $@ ${OBJECTS}

${OBJ}/%.o: ${SRC}/%.c
	$(CC) $(CFLAGS) -o $@ -c $<

.PHONY: clean
clean:
	rm ${TARGET}
	rm ${OBJ}/*.o
